package com.xun.controller;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.xun.bean.User;
import com.xun.mapper.UserMapper;
import com.xun.mapper.XmlUserMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.Arrays;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
 * @Package: com.xun.controller
 * @ClassName: UserController
 * @Author: Think
 * @CreateTime: 2021/6/15 16:05
 * @Description:
 */
@RestController
public class XmlUserController {
    @Autowired
    private XmlUserMapper xmlUserMapper;

    // 查询操作
    @GetMapping("/listXmlUsers")
    public List<User> listXmlUsers() {
        // SELECT user_id,user_name,age,user_email FROM zx_user
        return xmlUserMapper.listXmlUsers();
    }

    @GetMapping("/getXmlUserById/{userId}")
    public List<User> getXmlUserById(@PathVariable String userId) {
        // SELECT user_id,user_name,age,user_email FROM zx_user WHERE (user_id = ?)
        return xmlUserMapper.getXmUserById(userId);
    }
}
